Skip to content

Fix GH-15123: var_dump doesn't actually work on XMLReader #15130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2024

Conversation

nielsdos
Copy link
Member

Targeting master because it changes long standing behaviour, although what it currently does is useless anyway...

@nielsdos nielsdos linked an issue Jul 27, 2024 that may be closed by this pull request
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems a bit strange to have initialized properties when the object is actually not initialized?

@nielsdos
Copy link
Member Author

It seems a bit strange to have initialized properties when the object is actually not initialized?

Perhaps uninitialized isn't the right word. The error basically happens because you're reading a the isEmptyElement property before actually reading anything. The fact that other properties are able to be read is perhaps a bit weird (except for properties like depth maybe) but changing that would be a painful BC break.

@Girgias
Copy link
Member

Girgias commented Jul 28, 2024

Ah okay, yeah I think the error wording maybe should be improved then, as I thought it was similar to a DateTime object not being properly initialized

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what to do about the error message, but the rest seems OK

@nielsdos
Copy link
Member Author

What about something like "Failed to read property because no XML data has been read yet" ?

@Girgias
Copy link
Member

Girgias commented Jul 28, 2024

I think that is indeed a better error message! :)

@nielsdos nielsdos merged commit e0a2e2e into php:master Jul 28, 2024
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

var_dump doesn't actually work on XMLReader
2 participants